package com.ztesoft.web.index.db.dao;



import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

import javax.annotation.Resource;
import org.mybatis.spring.SqlSessionTemplate;
import org.mybatis.spring.support.SqlSessionDaoSupport;
import org.springframework.stereotype.Repository;

import com.ztesoft.web.index.db.dao.mapper.IIndexMapper;
import com.ztesoft.web.index.db.po.SpaceDataPO;

@Repository
public class IndexDao extends SqlSessionDaoSupport {

    @Resource(name = "majorSqlSessionTemplate")
    public void setSqlSessionTemplate(SqlSessionTemplate sqlSessionTemplate) {
        super.setSqlSessionTemplate(sqlSessionTemplate);
    }
    
    public BigDecimal getCheckUpData(int dataType,List<Integer> nodeIds){
    	return getMapper().getCheckUpData(dataType, nodeIds);
    }
    
    public BigDecimal getCleanUpData(int dataType,List<Integer> nodeIds){
    	return getMapper().getCleanUpData(dataType, nodeIds);
    }
    
    public SpaceDataPO getSpaceSize(int detectionType, List<Integer> nodeIds) {
    	return getMapper().getSpaceSize(detectionType, nodeIds);
    }
    
    public BigDecimal getBackUpDataSize(int sourceType, List<Integer> nodeIds,
    		String createDate,int offset) {
    	return getMapper().getBackUpDataSize(sourceType, nodeIds,createDate,offset);
    }
    
	public BigDecimal getCheckDataSize(int sourceType, List<Integer> nodeIds,
			String createDate,int offset){
		return getMapper().getCheckDataSize(sourceType, nodeIds,createDate,offset);
	}
	
	public BigDecimal getResultDataSize(int sourceType, List<Integer> nodeIds,
			String createDate,int offset){
		return getMapper().getResultDataSize(sourceType, nodeIds,createDate,offset);
	}

    public IIndexMapper getMapper() {
    	return getSqlSession().getMapper(IIndexMapper.class);
    }

	public int getIsCheckNum(int sourceType, List<Integer> nodeIds) {
		return getMapper().getIsCheckNum(sourceType, nodeIds);
	}

	public int searchTaskNum(Integer sourceType, List<Integer> nodeIds, String state,
			Date date) {
		return getMapper().searchTaskNum(sourceType,nodeIds,state,date);
	}

}
